function onComplete(responseText, responseXML)
{
  mainNode = responseXML.documentElement;
  if(mainNode.firstChild.nodeType == 1){
    imie = mainNode.firstChild.firstChild.nodeValue;
    nazwisko = mainNode.lastChild.firstChild.nodeValue;
  }
  else if(mainNode.firstChild.nodeType == 3){
    imie = mainNode.firstChild.nextSibling.firstChild.nodeValue;
    nazwisko = mainNode.lastChild.previousSibling.firstChild.nodeValue;
  }
  else{
    alert("Nieprawidłowa struktura danych.");
    return;
  }
  
  str = "Odczytane imię: " + imie + "<br>";
  str += "Odczytane nazwisko: " + nazwisko;
  
  var div = document.getElementById("dataDiv");
  div.innerHTML = str;
}
